package homework;

import java.util.ArrayList;
import java.util.HashSet;

public class Demo10 {
int value;
Demo10(int value) {
this.value = value;
}
public boolean equals(Object obj) {
if (obj instanceof Demo10) {
Demo10 foo = (Demo10) obj;
return value == foo.value;
} else {
return false;
}
}
public static void main(String[] args) {
	ArrayList list = new ArrayList();
	HashSet set = new HashSet();
	list.add(new Demo10(1));
	set.add(new Demo10(1));
	System.out.println(new Demo10(1).equals (new Demo10(1)) + ","+ list.contains(new Demo10(1)));
}
}